package com.cgy.utils.spider.header;

import java.util.List;

import com.google.common.collect.Lists;

/**
 * Cookie配置
 * @author CH
 *
 */
public class Headers {

	public List<Header> lHeaders;
	/**
	 * 初始化
	 * @return
	 */
	public Headers create() {
		this.lHeaders = Lists.newArrayList();
		return new Headers();
	}
	/**
	 * 添加cookie
	 * @param key 索引
	 * @param value 值
	 * @return
	 */
	public Headers cookie(String key, String value) {
		Header header = new Header();
		header.setHeaderKey(key);
		header.setHeaderVal(value);
		lHeaders.add(header);
		return this;
	}
	/**
	 * 获取所有cookie
	 * @return
	 */
	public List<Header> getHeader() {
		return this.lHeaders;
	}
	
}
